import 'package:rx_dart_app/utils/api_utils/index.dart';
import 'package:rxdart/rxdart.dart';

import '../api/login.dart';

class LoginModel {
  final BehaviorSubject<bool> _subject = BehaviorSubject.seeded(false);

  get loginStatus => _subject.value;

  get loginStream => _subject.stream;

  login() async {
    LoginBaseApi loginApi = LoginBaseApi();
    Map<String,dynamic> params = {
      "userName":"yin",
      "password":"123456"
    };
    loginApi.setParams = params;

    ResultJson? resultJson = await loginApi.request();
    if (resultJson != null) {
      print("登录成功");
      print(resultJson.toString());
    }
  }
}
